package org.quarenden.demo;

import org.quarenden.demo.util.SpringUtils;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

@SpringBootApplication
@EnableDiscoveryClient
@EnableHystrix
//@ComponentScan(basePackages={"org.quarenden.demo"})
public class IdGeneratorAppMain {
    public static void main(String[] args) {
        SpringApplication.run(IdGeneratorAppMain.class, args);

        /* 获取Spring容器里面的bean
        ApplicationContext ctx =  SpringApplication.run(IdGeneratorAppMain.class,args);
        String[] beanNames = ctx.getBeanDefinitionNames();

        System.out.println("所以beanNames个数："+beanNames.length);

        for(String bn:beanNames){

            if("springUtils".equals(bn)){
                System.out.println(SpringUtils.getBean("springUtils").toString());
            }else if("sequenceRepository".equals(bn)){
                System.out.println(SpringUtils.getBean("sequenceRepository").toString());
            }

        }

        */

    }
}
